import argparse
import json
import os
from src.main import run
def handle_config(path):
    if os.path.isfile(path):
        with open(path, 'r') as f:
            result = json.load(f)
            run(**result)
    else:
        raise FileNotFoundError(f"不存在文件:{str(path)}")

parser = argparse.ArgumentParser(description="")
parser.add_argument("--config", type=str,default="./config.json",help="path of the config")
args = parser.parse_args()
if args.config:
    print(handle_config(args.config))
